package labox.innovation.gameserver.model;

import junit.framework.TestCase;

public class ConsignmentCacheTest extends TestCase {
	ConsignmentCache cache=null;
	protected void setUp() throws Exception {
		super.setUp();
	}

	protected void tearDown() throws Exception {
		super.tearDown();
	}

	public void testReset() {
		cache=new ConsignmentCache();
		cache.setCurrentPage(4);
		int [] s=new int[]{1};
		cache.setSearchCondition(s);
		assertEquals(4, cache.getCurrentPage());
		assertEquals(s, cache.getSearchCondition());
		cache.reset();
		assertEquals(1, cache.getCurrentPage());
		assertEquals(null, cache.getSearchCondition());
		assertEquals(0, cache.getSearchType());
		assertTrue(cache.getPageData().size()==0);
	}

	public void testInit() {
		cache=new ConsignmentCache();
		int [] s=new int[]{1};
		cache.init(1, s);
		assertEquals(1, cache.getCurrentPage());
		assertEquals(s, cache.getSearchCondition());
		assertEquals(1, cache.getSearchType());
		assertTrue(cache.getPageData().size()==1);
	}

	public void testSetSearchCondition() {
		cache=new ConsignmentCache();
		assertEquals(null, cache.getSearchCondition());
		int [] s=new int[]{1,3,3};
		cache.setSearchCondition(s);
		assertEquals(s, cache.getSearchCondition());
	}

}
